<style>
.page_rain{
	position: absolute;top:0;bottom:0;width:100%;z-index:108;background: rgba(0, 0, 0, 0.3);display:none
}
</style>
<div ng-if="!pagedata.page_rainnone" class="page_rain">
		<div class="dd" ng-click="pagedata.getred()" style="left: 4px; top: 623px;"></div>
		<div class="startred"></div>
</div>
<div ng-if="pagedata.showgetred" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="width:80%;padding: 1rem;background:#fff">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showgetred=false"></i>
			<div class="fui-content" style="background:none;padding-bottom:0">
				<!--状态-->
				<div class="order_header">
					  <div class="red" style="width:3.6rem;margin:0 auto">
						<img style="width:3.6rem;height:3.6rem" ng-src="{{tomedia(pagedata.pluginset.getmoneytop) || '../addons/jy_weidish_xibei/resource/images/getmoneytop.png'}}">
					  </div>
					  <div class="order_detail_ststus c" style="padding:0.3rem;background:none">
							<div style="font-size: 0.85rem;">恭喜您获得{{pagedata.getmoney||0}}积分</div>
							<div class="c gray">可以前往个人中心查看积分~~</div>
					  </div>
					</div>
					<div class="weui_btn_area" style="margin:2rem 4rem;margin-bottom:0.5rem">				
						<a ng-click="pagedata.showgetred=false" class="weui_btn weui_btn_red" style="border-radius:1rem" href="javascript:">领取积分</a>
					</div>
			</div>
		</div>
	</div>
</div>
<script>
function raintime(){
		for(var i=0;i<4;i++){	
			var m=parseInt(Math.random()*700+100);
			var j2=parseInt(Math.random()*300+1200);
			var j=parseInt(Math.random()*($(window).width()+400)+000);
			var j1=parseInt(Math.random()*300+300);
			var n=parseInt(Math.random()*10+(-10));
			$('.startred').prepend('<div class="dd"></div>');
			$('.startred').children('div').eq(0).css({'left':j,'top':n});
			$('.startred').children('div').eq(0).animate({'left':j-j1,'top':$(window).height()+20},2800);
		}
};
scope.pagedata.start_game=function(){
	scope.pagedata.times=0
	var Timerr = setInterval(raintime,800);
	$(".page_rain").css("display","block");
	var removepackage = setInterval(function(){
			if(scope.pagedata.times>=60){
				clearInterval(Timerr);
				clearInterval(removepackage);
				scope.pagedata.page_rainnone=true;
				$(".page_rain").css("display","none");
			}
			scope.pagedata.times++;
			for(var jj=0;jj<$('.startred>div').size()/4;jj++){
					$('.startred>div').eq($('.startred>div').size()-jj).remove();
			}
	},1000);
}
$(document).on('touchstart', '.dd', function(){
	var random = Math.floor((Math.random()*10)+1);
	if(random>5){		
		scope.get('jy_weishop/game.give/get_gameres/id='+scope.pagedata.game_wait.id,function(res){
			scope.pagedata.getmoney=res.money
			scope.pagedata.showgetred=true;
			scope.pagedata.times=60;
			scope.pagedata.page_rainnone=true;
			$(".page_rain").css("display","none");
			window.scope.$evalAsync();
		});
	}else{
		$('.dd').css("background-position","0 -100px");	
	}
});
</script>